from __main__ import game;
from toee import *

def san_heartbeat( attachee, triggerer ):
	if (game.global_vars[777] >= 1):
		attachee.destroy()
	if (game.global_vars[777] == 0):
		game.new_sid = 0
		game.global_vars[777] = 1
	return RUN_DEFAULT


def san_start_combat( attachee, triggerer ):


## THIS IS USED FOR BREAK FREE
	for obj in game.party[0].group_list():
		if (obj.distance_to(attachee) <= 3 and obj.stat_level_get(stat_hp_current) >= -9):
			return RUN_DEFAULT		
	while(attachee.item_find(8903) != OBJ_HANDLE_NULL):
		attachee.item_find(8903).destroy()
	if (attachee.d20_query(Q_Is_BreakFree_Possible)):
		create_item_in_inventory( 8903, attachee )
##		attachee.d20_send_signal(S_BreakFree)


	return RUN_DEFAULT








